package com.yincheng.oes.business.exam.export.analysispaper.entity;

import org.apache.commons.lang3.StringUtils;

public class AnalysisKnowledge {

    private int index;
    /**
     * 知识点id
     */
    private Integer id;

    /**
     * 知识点路径
     */
    private String contents;

    /**
     * 关联错题id
     */
    private Integer quesId;

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContents() {
        if (contents == null) {
            return StringUtils.EMPTY;
        }
        String[] split = contents.split("--");
        if (split.length < 1) {
            return contents;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < split.length; i++) {
            sb.append(split[i]);
            if (i < split.length - 1) {
                sb.append("--");
            }
        }
        return sb.toString();
    }

    public void setContents(String contents) {
        this.contents = contents;
    }

    public Integer getQuesId() {
        return quesId;
    }

    public void setQuesId(Integer quesId) {
        this.quesId = quesId;
    }

}
